package com.carleasoft.mps.cms.business.train.controller;

import com.carleasoft.mps.cms.business.train.bean.po.TrainAndCasePo;
import com.carleasoft.mps.cms.business.train.bean.vo.AssessmentVo;
import com.carleasoft.mps.cms.business.train.bean.vo.CaseStatisticsVo;
import com.carleasoft.mps.cms.business.train.service.TrainPlanService;
import com.carleasoft.mps.core.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 首页训练概况和事件处理情况统计
 * @Author: fan
 */
@RestController
@RequestMapping("/trainAndCase")
public class HomeStatisticsController {
    @Autowired
    TrainPlanService trainPlanService;
    /**
     * 考核情况
     */
    @PostMapping("/assessment")
    public R<AssessmentVo> assessment(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.assessment(trainAndCasePo));
    }
    /**
     * 根据考核编码统计各分段占比
     */
    @PostMapping("/statisticsByExamCode")
    public R statisticsByExamCode(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.statisticsByExamCode(trainAndCasePo));
    }

    /**
     * 训练计划
     */
    @PostMapping("/planStatistics")
    public R planStatistics(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.planStatistics(trainAndCasePo));
    }
    /**
     * 用车情况
     */
    @PostMapping("/byCarStatistics")
    public R byCarStatistics(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.byCarStatistics(trainAndCasePo));
    }
    /**
     * 事件处理情况
     */
    @PostMapping("/caseStatistics")
    public R<CaseStatisticsVo> caseStatistics(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.caseStatistics(trainAndCasePo));
    }
    /**
     * 按月份统计
     */
    @PostMapping("/statisticsByMonth")
    public R statisticsByMonth(@RequestBody TrainAndCasePo trainAndCasePo){
        return R.ok(trainPlanService.statisticsByMonth(trainAndCasePo));
    }


}
